<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'uploadfy.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<link rel="stylesheet" type="text/css" href="resources/fw/plugin/upload/uploadify/uploadify.css">
	<%@include file="../include/include_jquery.jsp" %>
	<script type="text/javascript" src="resources/fw/plugin/upload/uploadify/jquery.uploadify.min.js"></script>

    <script type="text/javascript" src="resources/js/client/uploadify.js" charset="UTF-8"></script>
    <style type="text/css">
		.file_queue {
		    background-color: #FFF;
		    border-radius: 3px;
		    box-shadow: 0 1px 3px rgba(0,0,0,0.25);
		    height: 103px;
		    margin-bottom: 10px;
		    overflow: auto;
		    padding: 5px 10px;
		    width: 300px;
		} 
    </style>
   <script type="text/javascript">
	   var upload = null;
	   $(function() {
	   	$("#upload").on("click",function(event){
	   		upload.upload();
	   	});
	   	var upload_id = "file_upload";
	   	var queueID = "some_file_queue";
	   	var basePath = $("#basePath").val();
	   	var action  = "fileUpload";
	   	var sessionId = $("#sessionId").val();
	     var ext =	"*.*";
	     var limit = 3*1024;
	    var fileObjName = 'uploadFile';
	    var des = '支持的格式：';
	   	upload = new uploadify(upload_id,queueID,fileObjName,basePath,sessionId,ext,limit,action,des);
	   });
   </script>
  </head>
  
  <body> 
   <input type="hidden" id="basePath" value="<%=basePath %>"> 
    <input type="hidden" id="sessionId" value="<%=session.getId()%>">
    <h2>Basic Demo</h2>
    <div id="some_file_queue" class="file_queue" style="height: 100px;"></div>
	<p><input type="file" name="file_upload" id="file_upload" /></p>	
     <div id="progress"></div>
     <div id="message_box"></div>
     <button id="upload">上传</button>
  </body>
</html>
